package cn.credit.ms.dbms;

import java.io.Serializable;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author kejun
 * for dao return 
 */
public class Record extends AbstractMap<String, Serializable> {
	Map<String,Serializable> map; 
	
	public static Record wrap(Map m){
		return new Record(m);
	}
	
	public static List<Record> wrap(List<Map> src){
		List<Record> list = new ArrayList<>();
		for(Map m:src){
			list.add(new Record(m));
		}
		return list;
	}
	
	Record(Map<String,Serializable> map ){
		this.map=map;
	}
	
	@Override
	public Set<Entry<String, Serializable>> entrySet() {
		return map.entrySet();
	}
	
	@Override
	public Serializable put(String key, Serializable value) {
		return map.put(key, value);
	}

}
